08.c - Deployment-Guide
Relevant source files
This document provides comprehensive instructions for deploying the godeep.wiki system to production, including Vercel hosting configuration, environment variable setup, automation script initialization, and operational monitoring. This guide assumes you have already configured your GitHub App and understand the required environment variables.
For detailed information about individual environment variables and their purposes, see Environment Variables. For GitHub App creation and configuration, see GitHub App Configuration.
PrerequisitesLink copied!
Before beginning deployment, ensure you have:
| Requirement | Purpose | Verification Command |
|---|---|---|
| Node.js 18+ | Runtime environment | node --version |
| pnpm | Package manager | pnpm --version |
| GitHub App | OAuth and repository access | App created in GitHub settings |
| Stripe Account | Payment processing | Account created at stripe.com |
| Vercel Account | Hosting platform | Account created at vercel.com |
| ntfy.sh Topic | Event notifications | Topic name reserved |
Sources: README.md L43-L48
Vercel Deployment ArchitectureLink copied!
The following diagram illustrates the complete deployment architecture and how external services integrate with the Vercel-hosted application:
Deployment Components:
- Vercel Infrastructure: Hosts the Next.js application with serverless API routes and edge functions
- External Services: Third-party APIs that the application depends on for core functionality
- Automation Infrastructure: Separate server running bash scripts that listen to ntfy.sh notifications
- Environment Configuration: Split between Vercel-managed environment variables and local
.envfiles
Sources: README.md L265-L290
Vercel Deployment ProcessLink copied!
Method 1: One-Click Deployment (Recommended)Link copied!
The fastest deployment method uses Vercel's GitHub integration:
Steps:
- Click the Deploy with Vercel button in README.md L271
- Connect your GitHub account to Vercel
- Configure environment variables (see section below)
- Vercel will automatically build and deploy
Sources: README.md L265-L272
Method 2: Vercel CLI DeploymentLink copied!
For more control over the deployment process, use the Vercel CLI:
# Install Vercel CLI globallynpm install -g vercel# Authenticate with Vercelvercel login# Deploy to preview environmentvercel# Deploy to productionvercel --prod
Environment Variable Configuration via CLI:
# Add individual environment variablesvercel env add GITHUB_APP_SLUG productionvercel env add GITHUB_CLIENT_ID productionvercel env add GITHUB_CLIENT_SECRET productionvercel env add GITHUB_PRIVATE_KEY productionvercel env add NEXT_PUBLIC_ADMIN_PASSWORD productionvercel env add STRIPE_SECRET_KEY productionvercel env add STRIPE_WEBHOOK_SECRET productionvercel env add NTFY_TOPIC production# Pull environment variables to localvercel env pull .env.local
Sources: README.md L274-L290
Method 3: GitHub Integration (Continuous Deployment)Link copied!
For automated deployments on every commit:
- Connect Repository to Vercel: * Log into Vercel dashboard * Click "Add New Project" * Import your GitHub repository * Select
godeep.wikirepository - Configure Build Settings: * Framework Preset:
Next.js* Build Command:pnpm build* Output Directory:.next* Install Command:pnpm install - Configure Auto-Deployment: * Production Branch:
main* Preview Deployments: Enabled for pull requests
Sources: README.md L265-L290
Environment Variable Configuration in VercelLink copied!
Environment variables must be configured in the Vercel dashboard before deployment. The following table maps environment variables to their Vercel configuration:
| Variable Name | Category | Required | Exposed to Client | Where to Get Value |
|---|---|---|---|---|
GITHUB_APP_SLUG | GitHub | Yes | No | GitHub App settings URL slug |
GITHUB_APP_ID | GitHub | Yes | No | GitHub App settings |
GITHUB_CLIENT_ID | GitHub | Yes | No | GitHub App OAuth credentials |
GITHUB_CLIENT_SECRET | GitHub | Yes | No | GitHub App OAuth credentials (regenerate) |
GITHUB_PRIVATE_KEY | GitHub | Yes | No | Generate in GitHub App settings |
GITHUB_WEBHOOK_SECRET | GitHub | No | No | Generate in GitHub App webhooks |
NEXT_PUBLIC_APP_URL | Application | Yes | Yes | Your production domain |
NEXT_PUBLIC_ADMIN_PASSWORD | Admin | Yes | Yes | Choose secure password |
STRIPE_SECRET_KEY | Payment | Yes | No | Stripe dashboard API keys |
STRIPE_PUBLISHABLE_KEY | Payment | Yes | No | Stripe dashboard API keys |
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY | Payment | Yes | Yes | Stripe dashboard API keys |
STRIPE_WEBHOOK_SECRET | Payment | Yes | No | Stripe webhook endpoint |
NTFY_TOPIC | Automation | Yes | No | Your ntfy.sh topic name |
NEXT_PUBLIC_CF_BEACON_TOKEN | Analytics | No | Yes | Cloudflare Analytics |
Vercel Configuration Diagram:
Configuration Steps:
- Navigate to project settings:
https://vercel.com/<team>/<project>/settings/environment-variables - Add each environment variable with appropriate environment scope
- Select environments:
Production,Preview,Developmentas needed - For
GITHUB_PRIVATE_KEY, format as single line with\nfor newlines - Save and redeploy
Sources: .env.example L1-L15
Automation Script DeploymentLink copied!
The automation scripts run separately from Vercel on a server or local machine that subscribes to ntfy.sh notifications. These scripts handle repository cloning after customers connect their GitHub accounts.
Automation Script ArchitectureLink copied!
Script Setup InstructionsLink copied!
1. Dependency Installation:
# Install jq for JSON parsingbrew install jq # macOS# ORsudo apt-get install jq # Linux# Install GitHub CLIbrew install gh # macOS# ORsudo apt-get install gh # Linux# Authenticate GitHub CLIgh auth login
2. Environment Configuration:
Create a .env file in the project root with the admin password:
# .env file in project rootADMIN_PASSWORD=your_admin_password_here
Important: The ADMIN_PASSWORD in the local .env must match NEXT_PUBLIC_ADMIN_PASSWORD in Vercel environment variables.
Sources: scripts/README.md L9-L11
3. Script Execution:
# Navigate to project rootcd /path/to/godeep.wiki# Make script executablechmod +x scripts/ntfy-godeep-automation.sh# Run in foreground (for testing)./scripts/ntfy-godeep-automation.sh# Run in background (production)nohup ./scripts/ntfy-godeep-automation.sh > ~/ntfy-godeep.log 2>&1 &# Verify process is runningps aux | grep ntfy-godeep-automation# Monitor logs in real-timetail -f ~/ntfy-godeep.log
Sources: scripts/README.md L14-L21
Automation WorkflowLink copied!
The automation script executes the following sequence when triggered:
Sources: scripts/README.md L23-L51
Script Management CommandsLink copied!
| Task | Command | Description |
|---|---|---|
| Start foreground | ./scripts/ntfy-godeep-automation.sh | Run with console output |
| Start background | nohup ./scripts/ntfy-godeep-automation.sh > ~/ntfy-godeep.log 2>&1 & | Daemonize script |
| Stop script | pkill -f ntfy-godeep-automation | Terminate running process |
| View logs | tail -f ~/ntfy-godeep.log | Monitor real-time logs |
| Check status | ps aux | grep ntfy-godeep-automation | Verify script is running |
Sources: scripts/README.md L54-L63
Post-Deployment VerificationLink copied!
After deploying to Vercel and starting the automation scripts, verify all system components are functioning correctly:
Verification ChecklistLink copied!
Health Check TestsLink copied!
1. Landing Page Test:
curl -I https://your-domain.vercel.app# Expected: HTTP/2 200# Expected: content-type: text/html
2. GitHub OAuth Initiation Test:
curl -I https://your-domain.vercel.app/api/auth/github# Expected: HTTP/2 302# Expected: location: https://github.com/apps/your-app-slug/installations/new
3. Admin Panel Authentication Test:
curl -X POST https://your-domain.vercel.app/api/admin/generate-token \ -H "Content-Type: application/json" \ -d '{"password": "wrong_password", "installationId": "12345"}'# Expected: HTTP/2 401# Expected: {"error": "Invalid password"}
4. Stripe Webhook Test:
stripe trigger checkout.session.completed# Expected: Webhook received by /api/webhooks/stripe# Expected: ntfy notification sent
5. Automation Script Test:
# Send test notification to ntfy topiccurl -d "Test notification" https://ntfy.sh/your-topic# Check script logstail -n 20 ~/ntfy-godeep.log# Expected: Log entry showing notification received
Sources: README.md L314-L368
Operational MonitoringLink copied!
Monitoring ComponentsLink copied!
| Component | Monitoring Method | Key Metrics | Alert Threshold |
|---|---|---|---|
| Vercel Application | Vercel Dashboard | Request count, error rate, latency | Error rate > 5% |
| Stripe Webhooks | Stripe Dashboard | Delivery success, retries | Failed webhooks > 3 |
| GitHub API | Vercel Logs | Rate limit remaining, errors | Rate limit < 100 |
| ntfy.sh | Script logs | Message delivery, latency | Message loss detected |
| Automation Script | Process monitoring | Process uptime, log errors | Process down > 5 min |
| Disk Space | Server monitoring | ~/godeep-clones/ size | Usage > 80% |
Log AggregationLink copied!
Vercel Logs:
# Install Vercel CLInpm install -g vercel# View real-time logsvercel logs --follow# Filter by functionvercel logs --function=/api/webhooks/stripe# Search logsvercel logs --query="installation_id"
Automation Script Logs:
# View recent logstail -n 100 ~/ntfy-godeep.log# Monitor in real-timetail -f ~/ntfy-godeep.log# Search for errorsgrep -i "error" ~/ntfy-godeep.log# Search for specific installationgrep "installation_id: 12345678" ~/ntfy-godeep.log
Critical Correlation PointsLink copied!
The following diagram shows where to look for correlation data when troubleshooting customer issues:
Sources: README diagrams (Diagram 5: Data Correlation and Tracking)
Monitoring Dashboard SetupLink copied!
1. Vercel Analytics:
- Already enabled by default for all deployments
- View at:
https://vercel.com/<team>/<project>/analytics
2. Stripe Dashboard Monitoring:
- Configure webhook monitoring:
https://dashboard.stripe.com/webhooks - Set up email alerts for failed webhooks
3. Automation Script Monitoring:
# Create monitoring cron jobcrontab -e# Add this line to check script every 5 minutes*/5 * * * * pgrep -f ntfy-godeep-automation || (echo "Script down!" | mail -s "Alert: Automation Script Down" admin@example.com)
4. Disk Space Monitoring:
# Check disk usage of clone directorydu -sh ~/godeep-clones/# Set up alert for disk spaceif [ $(du -s ~/godeep-clones/ | awk '{print $1}') -gt 10000000 ]; then echo "Clone directory exceeds 10GB" | mail -s "Disk Space Alert" admin@example.comfi
Troubleshooting Common Deployment IssuesLink copied!
Issue: Build Failure in VercelLink copied!
Symptoms:
- Deployment fails during build step
- Error: "Type error: Cannot find module..."
Resolution:
- Verify all dependencies in
package.jsonare installed - Check TypeScript errors locally:
pnpm build - Ensure environment variables are set in Vercel
- Check build logs:
vercel logs --scope=build
Sources: README.md L314-L368
Issue: Environment Variables Not LoadingLink copied!
Symptoms:
- Runtime errors: "GITHUB_CLIENT_ID is undefined"
- Authentication failures
Resolution:
- Verify variables are set in Vercel dashboard
- Ensure correct environment scope (Production/Preview/Development)
- Redeploy after adding variables
- Check variable names match exactly (case-sensitive)
# Verify variables are loadedvercel env ls# Pull variables locally to verifyvercel env pull .env.localcat .env.local
Sources: .env.example L1-L15
Issue: Automation Script Not Receiving NotificationsLink copied!
Symptoms:
- Script process is running but not cloning repositories
- No log entries in
~/ntfy-godeep.log
Resolution:
- Verify ntfy topic name matches:
NTFY_TOPICin Vercel and script - Test ntfy subscription manually:
curl -s https://ntfy.sh/your-topic/json
- Check network connectivity to ntfy.sh
- Verify
.envfile exists in project root - Check script has read permissions for
.env
Sources: scripts/README.md L65-L81
Issue: GitHub App Authentication FailureLink copied!
Symptoms:
- Error: "Invalid client credentials"
- OAuth flow redirects to error page
Resolution:
- Verify
GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRETmatch GitHub App settings - Check callback URL is correct:
https://your-domain.vercel.app/api/auth/github/callback - Ensure GitHub App is installed in the correct organization/account
- Regenerate client secret and update in Vercel
Sources: README.md L320-L353
Issue: Stripe Webhook Signature Verification FailureLink copied!
Symptoms:
- Error: "No signatures found matching the expected signature"
- Webhooks marked as failed in Stripe dashboard
Resolution:
- Verify
STRIPE_WEBHOOK_SECRETmatches webhook endpoint in Stripe - Check webhook endpoint URL:
https://your-domain.vercel.app/api/webhooks/stripe - Ensure webhook secret is for the correct endpoint (test vs. production)
- Test webhook manually from Stripe dashboard
Sources: README.md L314-L368
Issue: Disk Space Full in Clone DirectoryLink copied!
Symptoms:
- Script errors: "No space left on device"
- Clone operations fail
Resolution:
# Check disk usagedf -h ~# List large clone directoriesdu -sh ~/godeep-clones/* | sort -hr | head -10# Clean up old clones (if needed)rm -rf ~/godeep-clones/old-customer-repo/# The script should auto-cleanup after pushing to GitHub# If not, check script logs for push failures
Sources: scripts/README.md L23-L51
Production Deployment ChecklistLink copied!
Use this checklist before marking deployment as production-ready:
Pre-DeploymentLink copied!
- All environment variables configured in Vercel
- GitHub App created and configured with correct permissions
- Stripe account configured with webhook endpoint
- ntfy.sh topic reserved and configured
.envfile created on automation server withADMIN_PASSWORD- Dependencies installed on automation server (jq, gh, git)
- GitHub CLI authenticated on automation server
DeploymentLink copied!
- Code pushed to main branch
- Vercel deployment completed successfully
- Build logs checked for errors
- Environment variables verified in Vercel dashboard
- Production domain configured
Post-DeploymentLink copied!
- Landing page loads correctly
- Payment flow tested (use Stripe test mode)
- GitHub OAuth flow tested
- Admin panel accessible with correct password
- Automation script started on server
- Test notification sent to ntfy.sh topic
- Test repository clone successful
- Logs monitoring configured
- Alert system configured
SecurityLink copied!
- All secrets rotated from test/development values
GITHUB_PRIVATE_KEYformatted correctly (single line with\n)- Admin password is strong and unique
- Webhook secrets are unique and secure
- GitHub App permissions are minimal (read-only)
- Automation server has restricted access
Sources: README.md L393-L406
Scaling ConsiderationsLink copied!
While the current architecture is designed for low-volume manual operation, consider these optimizations if scaling is needed:
| Bottleneck | Current Limitation | Scaling Solution |
|---|---|---|
| Manual Correlation | Requires log inspection to link payments to installations | Implement database to store session_id → installation_id mappings |
| Single Automation Server | One server running bash script | Deploy multiple script instances with load balancing |
| Disk Space | Clones stored temporarily on single server | Use ephemeral containers for cloning (Docker/Kubernetes) |
| Manual Documentation | Owner generates documentation manually | Implement automated documentation generation pipeline |
| ntfy.sh Dependency | Single point of failure for notifications | Add message queue redundancy (RabbitMQ/Redis) |
Note: The system is intentionally simple for the current low-volume use case. These scaling improvements should only be implemented if volume increases significantly.
Sources: README diagrams (Analysis sections)
Refresh this wiki
Last indexed: 23 November 2025 (922b35)
On this page
- Deployment Guide
- Prerequisites
- Vercel Deployment Architecture
- Vercel Deployment Process
- Method 1: One-Click Deployment (Recommended)
- Method 2: Vercel CLI Deployment
- Method 3: GitHub Integration (Continuous Deployment)
- Environment Variable Configuration in Vercel
- Automation Script Deployment
- Automation Script Architecture
- Script Setup Instructions
- Automation Workflow
- Script Management Commands
- Post-Deployment Verification
- Verification Checklist
- Health Check Tests
- Operational Monitoring
- Monitoring Components
- Log Aggregation
- Critical Correlation Points
- Monitoring Dashboard Setup
- Troubleshooting Common Deployment Issues
- Issue: Build Failure in Vercel
- Issue: Environment Variables Not Loading
- Issue: Automation Script Not Receiving Notifications
- Issue: GitHub App Authentication Failure
- Issue: Stripe Webhook Signature Verification Failure
- Issue: Disk Space Full in Clone Directory
- Production Deployment Checklist
- Pre-Deployment
- Deployment
- Post-Deployment
- Security
- Scaling Considerations
Ask Devin about godeep.wiki-jb
Syntax error in text
mermaid version 11.4.1